<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminArticleTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_article', function (Blueprint $table) {
            $table->increments('id');
            $table->string('title',255)->comment('文章名称');
            $table->integer('label_id')->nullable()->comment('标签id');
            $table->text('content')->comment('文章内容');
            $table->integer('read_num')->nullable()->default('0')->comment('文章阅读量');
            $table->integer('hot_bot')->nullable()->default('0')->comment('是否上热搜');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_article');
    }
}
